package cn.jji8.QSGUI;

import cn.jji8.QSGUI.Gui.Gui;
import cn.jji8.QSGUI.Gui.GuiConfigLoad;
import cn.jji8.QSGUI.quick.command.CommandImplement;
import cn.jji8.QSGUI.quick.command.CommandManger;
import cn.jji8.QSGUI.quick.logger.Logger;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

public class CommandLoad {
    static void load(JavaPlugin main){
        CommandManger.addCommand(new String[]{"reload", "重新加载"}, new CommandImplement() {
            @Override
            public void command(CommandSender commandSender, String[] args) {
                if(!commandSender.hasPermission("QSGUI.reload")){
                    Logger.putPlayerChat(commandSender,"你没有执行此命令的权限,需要：QSGUI.reload");
                    return;
                }
                GuiConfigLoad.load(main);
                Gui.reload();
                Logger.putPlayerChat(commandSender,"重载成功！");
            }
        },new String[][]{{}});
    }
}
